namespace Evaluant.NPOExample.Data{
	using System.Collections;

	public class PersonNPOHelper {
		public static void BeforeCreate
			(IDictionary objectFields, IDictionary dataFields){
		}
		public static void BeforeUpdate
			(IDictionary objectFields, IDictionary dataFields){
		}
		public static void AfterLoad
			(IDictionary objectFields, IDictionary dataFields){
			// schema migration scheme
			// we suppose a new field is added to the objects
			// but not yet available in the persistence system
			if(objectFields.Contains("m_age") 
				&& ! dataFields.Contains("m_age")){
				// init the age to 25, it will be 
				// automatically saved on next sync
				objectFields["m_age"] = 25;
			}
		}
	}
}
